<!-- HTML header for doxygen 1.8.8-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <!-- For Mobile Devices -->
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
        <meta name="generator" content="Doxygen 1.8.17"/>
        <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
        <title>QuEST: test_unitaries.cpp File Reference</title>
        <!--<link href="tabs.css" rel="stylesheet" type="text/css"/>-->
        <script type="text/javascript" src="dynsections.js"></script>
        <link href="doxygen.css" rel="stylesheet" type="text/css" />
        <link href="style.css" rel="stylesheet" type="text/css"/>
        <link href='https://fonts.googleapis.com/css?family=Roboto+Slab' rel='stylesheet' type='text/css'>
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
        <link href="jquery.smartmenus.bootstrap.css" rel="stylesheet">
        <script type="text/javascript" src="jquery.smartmenus.js"></script>
        <!-- SmartMenus jQuery Bootstrap Addon -->
        <script type="text/javascript" src="jquery.smartmenus.bootstrap.js"></script>
        <!-- SmartMenus jQuery plugin -->
    </head>
    <body>
        <nav class="navbar navbar-default" role="navigation">
            <div class="container">
                <div class="navbar-header">
                    <a class="navbar-brand"><img alt="Logo" src="logo.png"/></a>
                    <a class="navbar-brand"><b>QuEST</b> v3.2.0<br>The Quantum Exact Simulation Toolkit</a>
                </div>
            </div>
        </nav>
        <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
            <div class="content" id="content">
                <div class="container">
                    <div class="row">
                        <div class="col-sm-12 panel " style="padding-bottom: 15px;">
                            <div style="margin-bottom: 15px;">
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',false,false,'search.php','Search');
});
/* @license-end */</script>
<div id="main-nav"></div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_d522931ffa1371640980b621734a4381.html">Users</a></li><li class="navelem"><a class="el" href="dir_70834f0dcd10de01d2e35ab402a2238e.html">tysonjones</a></li><li class="navelem"><a class="el" href="dir_1957401ef452be7528010ba0f4832a45.html">Desktop</a></li><li class="navelem"><a class="el" href="dir_dee4414d5d72b49a9429e079789ffd08.html">GithubRepos</a></li><li class="navelem"><a class="el" href="dir_a89b43d59316bb5045aa22bb53a67d29.html">QuEST</a></li><li class="navelem"><a class="el" href="dir_e791dcdec8c5d319683d04485e4067ac.html">tests</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">test_unitaries.cpp File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &quot;catch.hpp&quot;</code><br />
<code>#include &quot;<a class="el" href="QuEST_8h_source.html">QuEST.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="utilities_8hpp_source.html">utilities.hpp</a>&quot;</code><br />
</div>
<p><a href="test__unitaries_8cpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:aec8f698a7995e17e0ff1055526d2e5d4"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="test__unitaries_8cpp.html#aec8f698a7995e17e0ff1055526d2e5d4">CLEANUP_TEST</a>(quregVec,  quregMatr)</td></tr>
<tr class="memdesc:aec8f698a7995e17e0ff1055526d2e5d4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destroys the data structures made by PREPARE_TEST.  <a href="test__unitaries_8cpp.html#aec8f698a7995e17e0ff1055526d2e5d4">More...</a><br /></td></tr>
<tr class="separator:aec8f698a7995e17e0ff1055526d2e5d4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae34496c47ef565b741782f01e710ea2c"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="test__unitaries_8cpp.html#ae34496c47ef565b741782f01e710ea2c">PREPARE_TEST</a>(quregVec,  quregMatr,  refVec,  refMatr)</td></tr>
<tr class="memdesc:ae34496c47ef565b741782f01e710ea2c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Prepares the needed data structures for unit testing unitaries.  <a href="test__unitaries_8cpp.html#ae34496c47ef565b741782f01e710ea2c">More...</a><br /></td></tr>
<tr class="separator:ae34496c47ef565b741782f01e710ea2c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga282f468229dd7da6f78f9ac98990a477"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__unittest.html#ga282f468229dd7da6f78f9ac98990a477">TEST_CASE</a> (&quot;compactUnitary&quot;, &quot;[unitaries]&quot;)</td></tr>
<tr class="separator:ga282f468229dd7da6f78f9ac98990a477"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7c4749ab5725b6608bf63313b2aaf48f"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__unittest.html#ga7c4749ab5725b6608bf63313b2aaf48f">TEST_CASE</a> (&quot;controlledCompactUnitary&quot;, &quot;[unitaries]&quot;)</td></tr>
<tr class="separator:ga7c4749ab5725b6608bf63313b2aaf48f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga682affdaafaac3c37cb7155d9aae588b"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__unittest.html#ga682affdaafaac3c37cb7155d9aae588b">TEST_CASE</a> (&quot;controlledMultiQubitUnitary&quot;, &quot;[unitaries]&quot;)</td></tr>
<tr class="separator:ga682affdaafaac3c37cb7155d9aae588b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6547a0c5b3e34f461a9b0fd859445e78"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__unittest.html#ga6547a0c5b3e34f461a9b0fd859445e78">TEST_CASE</a> (&quot;controlledNot&quot;, &quot;[unitaries]&quot;)</td></tr>
<tr class="separator:ga6547a0c5b3e34f461a9b0fd859445e78"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga68c2309cfe69baf8733fd333451353f1"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__unittest.html#ga68c2309cfe69baf8733fd333451353f1">TEST_CASE</a> (&quot;controlledPauliY&quot;, &quot;[unitaries]&quot;)</td></tr>
<tr class="separator:ga68c2309cfe69baf8733fd333451353f1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa1bacf29d7a0a247e5a944bf76f086d0"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__unittest.html#gaa1bacf29d7a0a247e5a944bf76f086d0">TEST_CASE</a> (&quot;controlledPhaseFlip&quot;, &quot;[unitaries]&quot;)</td></tr>
<tr class="separator:gaa1bacf29d7a0a247e5a944bf76f086d0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaab0f5a29d8c51dc46ae1dd14b453b920"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__unittest.html#gaab0f5a29d8c51dc46ae1dd14b453b920">TEST_CASE</a> (&quot;controlledPhaseShift&quot;, &quot;[unitaries]&quot;)</td></tr>
<tr class="separator:gaab0f5a29d8c51dc46ae1dd14b453b920"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga59fc931b7033092612225a53c41a2296"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__unittest.html#ga59fc931b7033092612225a53c41a2296">TEST_CASE</a> (&quot;controlledRotateAroundAxis&quot;, &quot;[unitaries]&quot;)</td></tr>
<tr class="separator:ga59fc931b7033092612225a53c41a2296"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga19c50d3654196a8c0f0574505c8ef816"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__unittest.html#ga19c50d3654196a8c0f0574505c8ef816">TEST_CASE</a> (&quot;controlledRotateX&quot;, &quot;[unitaries]&quot;)</td></tr>
<tr class="separator:ga19c50d3654196a8c0f0574505c8ef816"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8b6968998c3a5d74b05d440c5e342b66"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__unittest.html#ga8b6968998c3a5d74b05d440c5e342b66">TEST_CASE</a> (&quot;controlledRotateY&quot;, &quot;[unitaries]&quot;)</td></tr>
<tr class="separator:ga8b6968998c3a5d74b05d440c5e342b66"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga803a1dbe819fc49e4844b50d237a4dd6"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__unittest.html#ga803a1dbe819fc49e4844b50d237a4dd6">TEST_CASE</a> (&quot;controlledRotateZ&quot;, &quot;[unitaries]&quot;)</td></tr>
<tr class="separator:ga803a1dbe819fc49e4844b50d237a4dd6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2e579c6fbc9f3f280fbfbea944de9c42"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__unittest.html#ga2e579c6fbc9f3f280fbfbea944de9c42">TEST_CASE</a> (&quot;controlledTwoQubitUnitary&quot;, &quot;[unitaries]&quot;)</td></tr>
<tr class="separator:ga2e579c6fbc9f3f280fbfbea944de9c42"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga9b4d4087da235bc2ea909ca2586c8ab6"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__unittest.html#ga9b4d4087da235bc2ea909ca2586c8ab6">TEST_CASE</a> (&quot;controlledUnitary&quot;, &quot;[unitaries]&quot;)</td></tr>
<tr class="separator:ga9b4d4087da235bc2ea909ca2586c8ab6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab0eaeafe2da6bc602f8c79ecb986eb7f"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__unittest.html#gab0eaeafe2da6bc602f8c79ecb986eb7f">TEST_CASE</a> (&quot;hadamard&quot;, &quot;[unitaries]&quot;)</td></tr>
<tr class="separator:gab0eaeafe2da6bc602f8c79ecb986eb7f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4a7295ff2f6ab9b0569da7a4f34056fc"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__unittest.html#ga4a7295ff2f6ab9b0569da7a4f34056fc">TEST_CASE</a> (&quot;multiControlledMultiQubitUnitary&quot;, &quot;[unitaries]&quot;)</td></tr>
<tr class="separator:ga4a7295ff2f6ab9b0569da7a4f34056fc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac41ea931fcc90e931b0ca2bf98cd9dd0"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__unittest.html#gac41ea931fcc90e931b0ca2bf98cd9dd0">TEST_CASE</a> (&quot;multiControlledPhaseFlip&quot;, &quot;[unitaries]&quot;)</td></tr>
<tr class="separator:gac41ea931fcc90e931b0ca2bf98cd9dd0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7c7b67eb8b1ff63a941caa2d9e830cd7"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__unittest.html#ga7c7b67eb8b1ff63a941caa2d9e830cd7">TEST_CASE</a> (&quot;multiControlledPhaseShift&quot;, &quot;[unitaries]&quot;)</td></tr>
<tr class="separator:ga7c7b67eb8b1ff63a941caa2d9e830cd7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8e86adfbd714cc3309fe15efaac8a33f"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__unittest.html#ga8e86adfbd714cc3309fe15efaac8a33f">TEST_CASE</a> (&quot;multiControlledTwoQubitUnitary&quot;, &quot;[unitaries]&quot;)</td></tr>
<tr class="separator:ga8e86adfbd714cc3309fe15efaac8a33f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga9fc32abbfb35c76915b3b3e1ec3656d8"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__unittest.html#ga9fc32abbfb35c76915b3b3e1ec3656d8">TEST_CASE</a> (&quot;multiControlledUnitary&quot;, &quot;[unitaries]&quot;)</td></tr>
<tr class="separator:ga9fc32abbfb35c76915b3b3e1ec3656d8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf396e2e9e1e995adfb30947201c23590"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__unittest.html#gaf396e2e9e1e995adfb30947201c23590">TEST_CASE</a> (&quot;multiQubitUnitary&quot;, &quot;[unitaries]&quot;)</td></tr>
<tr class="separator:gaf396e2e9e1e995adfb30947201c23590"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga838f36bbb6dcb2aedca45153317fad16"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__unittest.html#ga838f36bbb6dcb2aedca45153317fad16">TEST_CASE</a> (&quot;multiRotatePauli&quot;, &quot;[unitaries]&quot;)</td></tr>
<tr class="separator:ga838f36bbb6dcb2aedca45153317fad16"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga269a80f587f1aee7e9eddfbc18022f10"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__unittest.html#ga269a80f587f1aee7e9eddfbc18022f10">TEST_CASE</a> (&quot;multiRotateZ&quot;, &quot;[unitaries]&quot;)</td></tr>
<tr class="separator:ga269a80f587f1aee7e9eddfbc18022f10"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga293349dc468b808c15bd68891370ef11"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__unittest.html#ga293349dc468b808c15bd68891370ef11">TEST_CASE</a> (&quot;multiStateControlledUnitary&quot;, &quot;[unitaries]&quot;)</td></tr>
<tr class="separator:ga293349dc468b808c15bd68891370ef11"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga873998873d09f3c3fa51e46c39076dee"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__unittest.html#ga873998873d09f3c3fa51e46c39076dee">TEST_CASE</a> (&quot;pauliX&quot;, &quot;[unitaries]&quot;)</td></tr>
<tr class="separator:ga873998873d09f3c3fa51e46c39076dee"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga751edff600b7ffba3a9d85565e246325"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__unittest.html#ga751edff600b7ffba3a9d85565e246325">TEST_CASE</a> (&quot;pauliY&quot;, &quot;[unitaries]&quot;)</td></tr>
<tr class="separator:ga751edff600b7ffba3a9d85565e246325"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga25a1ad7cfce5d2dcf4365bc107aeeb6c"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__unittest.html#ga25a1ad7cfce5d2dcf4365bc107aeeb6c">TEST_CASE</a> (&quot;pauliZ&quot;, &quot;[unitaries]&quot;)</td></tr>
<tr class="separator:ga25a1ad7cfce5d2dcf4365bc107aeeb6c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga80f19ddf4e3207f35d4e2c75da05de0e"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__unittest.html#ga80f19ddf4e3207f35d4e2c75da05de0e">TEST_CASE</a> (&quot;phaseShift&quot;, &quot;[unitaries]&quot;)</td></tr>
<tr class="separator:ga80f19ddf4e3207f35d4e2c75da05de0e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa95c4914751cec33d489db13ee199043"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__unittest.html#gaa95c4914751cec33d489db13ee199043">TEST_CASE</a> (&quot;rotateAroundAxis&quot;, &quot;[unitaries]&quot;)</td></tr>
<tr class="separator:gaa95c4914751cec33d489db13ee199043"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8ab0a252e1289bc18855c992f2830cd8"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__unittest.html#ga8ab0a252e1289bc18855c992f2830cd8">TEST_CASE</a> (&quot;rotateX&quot;, &quot;[unitaries]&quot;)</td></tr>
<tr class="separator:ga8ab0a252e1289bc18855c992f2830cd8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga00ec5df7831d054696e55454f32435f9"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__unittest.html#ga00ec5df7831d054696e55454f32435f9">TEST_CASE</a> (&quot;rotateY&quot;, &quot;[unitaries]&quot;)</td></tr>
<tr class="separator:ga00ec5df7831d054696e55454f32435f9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga62bc1f37d73821911d160c2d4aab2e2a"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__unittest.html#ga62bc1f37d73821911d160c2d4aab2e2a">TEST_CASE</a> (&quot;rotateZ&quot;, &quot;[unitaries]&quot;)</td></tr>
<tr class="separator:ga62bc1f37d73821911d160c2d4aab2e2a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab9235c6edcb882a5d131013eaea4ea4a"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__unittest.html#gab9235c6edcb882a5d131013eaea4ea4a">TEST_CASE</a> (&quot;sGate&quot;, &quot;[unitaries]&quot;)</td></tr>
<tr class="separator:gab9235c6edcb882a5d131013eaea4ea4a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac538ad512deccd07b15326bb3fcd864e"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__unittest.html#gac538ad512deccd07b15326bb3fcd864e">TEST_CASE</a> (&quot;sqrtSwapGate&quot;, &quot;[unitaries]&quot;)</td></tr>
<tr class="separator:gac538ad512deccd07b15326bb3fcd864e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga199ce1e1b6d7192b3a5477920b0d03e2"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__unittest.html#ga199ce1e1b6d7192b3a5477920b0d03e2">TEST_CASE</a> (&quot;swapGate&quot;, &quot;[unitaries]&quot;)</td></tr>
<tr class="separator:ga199ce1e1b6d7192b3a5477920b0d03e2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4296b3ea07d5a25be3f5bd0e87459112"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__unittest.html#ga4296b3ea07d5a25be3f5bd0e87459112">TEST_CASE</a> (&quot;tGate&quot;, &quot;[unitaries]&quot;)</td></tr>
<tr class="separator:ga4296b3ea07d5a25be3f5bd0e87459112"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga572d6aa93309f0de2004e2ede2a302e3"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__unittest.html#ga572d6aa93309f0de2004e2ede2a302e3">TEST_CASE</a> (&quot;twoQubitUnitary&quot;, &quot;[unitaries]&quot;)</td></tr>
<tr class="separator:ga572d6aa93309f0de2004e2ede2a302e3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga826c9b5aef57549316ebef503203d85b"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__unittest.html#ga826c9b5aef57549316ebef503203d85b">TEST_CASE</a> (&quot;unitary&quot;, &quot;[unitaries]&quot;)</td></tr>
<tr class="separator:ga826c9b5aef57549316ebef503203d85b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Unit testing for QuEST's 'unitaries' API. The tests are in alphabetical order of the API doc.</p>
<p>These tests work by constructing, from the unitary specification (e.g. control and target qubits), a full-Hilbert space complex matrix. This is then multiplied onto statevectors, or multiplied and it's conjugate-transpose right-multiplied onto density matrices.</p>
<p>QuEST's user validation handling is unit tested by redefining exitWithError (a weak C symbol) to throw a C++ exception, caught by the Catch2 library.</p>
<dl class="section author"><dt>Author</dt><dd>Tyson Jones </dd></dl>

<p class="definition">Definition in file <a class="el" href="test__unitaries_8cpp_source.html">test_unitaries.cpp</a>.</p>
</div><h2 class="groupheader">Macro Definition Documentation</h2>
<a id="aec8f698a7995e17e0ff1055526d2e5d4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aec8f698a7995e17e0ff1055526d2e5d4">&#9670;&nbsp;</a></span>CLEANUP_TEST</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define CLEANUP_TEST</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">quregVec, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">quregMatr&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">    <a class="code" href="group__type.html#ga8e1e6ad3254892edc2ee08712ea9d692">destroyQureg</a>(quregVec, <a class="code" href="main_8cpp.html#a718130cc1fc36cde991aff3d4c85c47d">QUEST_ENV</a>); \</div>
<div class="line">    destroyQureg(quregMatr, <a class="code" href="main_8cpp.html#a718130cc1fc36cde991aff3d4c85c47d">QUEST_ENV</a>);</div>
</div><!-- fragment -->
<p>Destroys the data structures made by PREPARE_TEST. </p>

<p class="definition">Definition at line <a class="el" href="test__unitaries_8cpp_source.html#l00033">33</a> of file <a class="el" href="test__unitaries_8cpp_source.html">test_unitaries.cpp</a>.</p>

</div>
</div>
<a id="ae34496c47ef565b741782f01e710ea2c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae34496c47ef565b741782f01e710ea2c">&#9670;&nbsp;</a></span>PREPARE_TEST</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define PREPARE_TEST</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">quregVec, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">quregMatr, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">refVec, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">refMatr&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">    <a class="code" href="structQureg.html">Qureg</a> quregVec = <a class="code" href="group__type.html#ga3392816c0643414165c2f5caeec17df0">createQureg</a>(<a class="code" href="utilities_8hpp.html#a2f52338126bb8cdf7fcf68eaf01c546a">NUM_QUBITS</a>, <a class="code" href="main_8cpp.html#a718130cc1fc36cde991aff3d4c85c47d">QUEST_ENV</a>); \</div>
<div class="line">    Qureg quregMatr = <a class="code" href="group__type.html#ga93e55b6650b408abb30a1d4a8bce757c">createDensityQureg</a>(<a class="code" href="utilities_8hpp.html#a2f52338126bb8cdf7fcf68eaf01c546a">NUM_QUBITS</a>, <a class="code" href="main_8cpp.html#a718130cc1fc36cde991aff3d4c85c47d">QUEST_ENV</a>); \</div>
<div class="line">    initDebugState(quregVec); \</div>
<div class="line">    initDebugState(quregMatr); \</div>
<div class="line">    QVector refVec = <a class="code" href="group__testutilities.html#gade0e7c37811a69f1c21c88c11943a19f">toQVector</a>(quregVec); \</div>
<div class="line">    QMatrix refMatr = <a class="code" href="group__testutilities.html#ga253946523907014c4f198d2bb38d4913">toQMatrix</a>(quregMatr);</div>
</div><!-- fragment -->
<p>Prepares the needed data structures for unit testing unitaries. </p>
<p>This creates a statevector and density matrix of the size NUM_QUBITS, and corresponding QVector and QMatrix instances for analytic comparison. </p>

<p class="definition">Definition at line <a class="el" href="test__unitaries_8cpp_source.html#l00024">24</a> of file <a class="el" href="test__unitaries_8cpp_source.html">test_unitaries.cpp</a>.</p>

</div>
</div>
</div><!-- contents -->
<div class="ttc" id="amain_8cpp_html_a718130cc1fc36cde991aff3d4c85c47d"><div class="ttname"><a href="main_8cpp.html#a718130cc1fc36cde991aff3d4c85c47d">QUEST_ENV</a></div><div class="ttdeci">QuESTEnv QUEST_ENV</div><div class="ttdoc">The global QuESTEnv instance, to be created and destroyed once in this main(), so that the MPI enviro...</div><div class="ttdef"><b>Definition:</b> <a href="main_8cpp_source.html#l00020">main.cpp:20</a></div></div>
<div class="ttc" id="autilities_8hpp_html_a2f52338126bb8cdf7fcf68eaf01c546a"><div class="ttname"><a href="utilities_8hpp.html#a2f52338126bb8cdf7fcf68eaf01c546a">NUM_QUBITS</a></div><div class="ttdeci">#define NUM_QUBITS</div><div class="ttdoc">The default number of qubits in the registers created for unit testing (both statevectors and density...</div><div class="ttdef"><b>Definition:</b> <a href="utilities_8hpp_source.html#l00036">utilities.hpp:36</a></div></div>
<div class="ttc" id="agroup__testutilities_html_ga253946523907014c4f198d2bb38d4913"><div class="ttname"><a href="group__testutilities.html#ga253946523907014c4f198d2bb38d4913">toQMatrix</a></div><div class="ttdeci">QMatrix toQMatrix(ComplexMatrix2 src)</div><div class="ttdoc">Returns a copy of the given 2-by-2 matrix.</div><div class="ttdef"><b>Definition:</b> <a href="utilities_8cpp_source.html#l00869">utilities.cpp:869</a></div></div>
<div class="ttc" id="agroup__testutilities_html_gade0e7c37811a69f1c21c88c11943a19f"><div class="ttname"><a href="group__testutilities.html#gade0e7c37811a69f1c21c88c11943a19f">toQVector</a></div><div class="ttdeci">QVector toQVector(Qureg qureg)</div><div class="ttdoc">Returns an equal-size copy of the given state-vector qureg.</div><div class="ttdef"><b>Definition:</b> <a href="utilities_8cpp_source.html#l00938">utilities.cpp:938</a></div></div>
<div class="ttc" id="agroup__type_html_ga8e1e6ad3254892edc2ee08712ea9d692"><div class="ttname"><a href="group__type.html#ga8e1e6ad3254892edc2ee08712ea9d692">destroyQureg</a></div><div class="ttdeci">void destroyQureg(Qureg qureg, QuESTEnv env)</div><div class="ttdoc">Deallocate a Qureg object representing a set of qubits.</div><div class="ttdef"><b>Definition:</b> <a href="QuEST_8c_source.html#l00077">QuEST.c:77</a></div></div>
<div class="ttc" id="astructQureg_html"><div class="ttname"><a href="structQureg.html">Qureg</a></div><div class="ttdoc">Represents a system of qubits.</div><div class="ttdef"><b>Definition:</b> <a href="QuEST_8h_source.html#l00203">QuEST.h:203</a></div></div>
<div class="ttc" id="agroup__type_html_ga3392816c0643414165c2f5caeec17df0"><div class="ttname"><a href="group__type.html#ga3392816c0643414165c2f5caeec17df0">createQureg</a></div><div class="ttdeci">Qureg createQureg(int numQubits, QuESTEnv env)</div><div class="ttdoc">Create a Qureg object representing a set of qubits which will remain in a pure state.</div><div class="ttdef"><b>Definition:</b> <a href="QuEST_8c_source.html#l00036">QuEST.c:36</a></div></div>
<div class="ttc" id="agroup__type_html_ga93e55b6650b408abb30a1d4a8bce757c"><div class="ttname"><a href="group__type.html#ga93e55b6650b408abb30a1d4a8bce757c">createDensityQureg</a></div><div class="ttdeci">Qureg createDensityQureg(int numQubits, QuESTEnv env)</div><div class="ttdoc">Create a Qureg for qubits which are represented by a density matrix, and can be in mixed states.</div><div class="ttdef"><b>Definition:</b> <a href="QuEST_8c_source.html#l00050">QuEST.c:50</a></div></div>
<!-- HTML footer for doxygen 1.8.8-->
<!-- start footer part -->
</div>
</div>
</div>
</div>
</div>
</body>
        <script type="text/javascript" src="boot.js"></script>
</html>
